<p:dialog xmlns="http://www.w3.org/1999/xhtml"
      	  xmlns:h="http://java.sun.com/jsf/html"
      	  xmlns:f="http://java.sun.com/jsf/core"
      	  xmlns:ui="http://java.sun.com/jsf/facelets"
      	  xmlns:p="http://primefaces.org/ui"
      	  modal="true"  resizable="true" width="40%"
		  widgetVar="dialogProfessor" id="idDialogProfessor" closable="true"
		  appendTo="@(body)" header="Professores"> 	
  	
<h:form id="formDialogProfessor" prependId="false">
<h:panelGroup id="pgDialogProfessor" >
 	<p:messages id="messagesAvFisicaProfessor" closable="true"/> 
    	<h:panelGrid columns="3" style="text-align:center; margin-top:20px; margin-right:10%; margin-bottom:20px">  
            <h:outputLabel value="Código" style="font-size:14px; float:left; padding-right:20px "/>  
            <h:outputLabel value="Professor" style="font-size:14px; float:left"/> 
            <h:outputLabel />
            <p:inputText value="#{avaliacaoFisicaBean.professor.idFuncionario}" styleClass="inputId">
            	<p:ajax listener="#{avaliacaoFisicaBean.ajaxGet}"/>
            </p:inputText>  
  			<p:inputText value="#{avaliacaoFisicaBean.professor.nome}" maxlength="40" styleClass="inputDescricao">
  				<p:ajax listener="#{avaliacaoFisicaBean.ajaxGet}"/>
            </p:inputText>  
  			<p:commandButton value="Consultar" actionListener="#{avaliacaoFisicaBean.findFuncionario}" process="@this" update="dataTableAvaliacaoFisica"
    				 style="margin-left:0px;" styleClass="commandButton"/> 
        </h:panelGrid>  
    <p:dataTable id="dataTableAvaliacaoFisica" var="professor" value="#{avaliacaoFisicaBean.dmProfessor}"  
    			 rowKey="#{professor.idFuncionario}"  selectionMode="single"
    			 style="padding-top:20px;" paginator="true" rows="10">     
		<p:column sortBy="#{professor.idFuncionario}" style="width:4%; text-align:center">  
            <f:facet name="header">  
                <h:outputText value="Código" />  
            </f:facet>  
            <h:outputText value="#{professor.idFuncionario}" />  
        </p:column>  
  
        <p:column sortBy="#{professor.nome}">  
            <f:facet name="header">  
                <h:outputText value="Professor" />  
            </f:facet>  
            <h:outputText value="#{professor.nome}" />  
        </p:column>  
        
        <p:column style="width:4%; text-align:center">  
        	<f:facet name="header">
        	 <h:outputText value="Selecionar" />
        	</f:facet>
         	<p:commandButton id="selectButtonEditar" actionListener="#{avaliacaoFisicaBean.addProfessor}" process="@this" icon="ui-icon-circle-plus" title="Add" />
        </p:column> 

    </p:dataTable>   

 </h:panelGroup>
 </h:form>
</p:dialog>
